{% extends "base.html" %}
{% block css -%}
<style type="text/css">
.usrtb {
width:100%;
font-size:0.8em;
}
.usrtb th{text-align:center;}
</style>
{% endblock -%}
{% block content -%}
<form class="pure-form pure-form-aligned" action="" method="POST">
<fieldset>
    <legend>{{_("Change Password")}}</legend>
    {% if chpwdtips -%}
    <p style="color:red;font-size:0.8em;">{{chpwdtips}}</p>
    {% endif -%}
    <div class="pure-control-group">
        <label for="orgpwd">{{_("Old password")}}</label>
        <input type="password" name="op" id="orgpwd">
    </div>
    <div class="pure-control-group">
        <label for="newpwd1">{{_("New password")}}</label>
        <input type="password" name="p1" id="newpwd1">
    </div>
    <div class="pure-control-group">
        <label for="newpwd2">{{_("Confirm password")}}</label>
        <input type="password" name="p2" id="newpwd2">
    </div>
    <div class="pure-controls">
        <button type="submit" class="pure-button">{{_("Confirm Change")}}</button>
    </div>
</fieldset>
</form>
{% if nickname == 'admin' -%}
<form class="pure-form pure-form-aligned" action="" method="POST" style="margin-top:10px;">
<fieldset>
    <legend>{{_("Add Account")}}</legend>
    {% if actips -%}
    <p style="color:red;font-size:0.8em;">{{actips}}</p>
    {% endif -%}
    <p style="font-size:0.8em;color:grey;">{{_("Note : No supports many accounts for limit of free account of GAE.")}}</p>
    <div class="pure-control-group">
        <label for="username">{{_("Username")}}</label>
        <input type="text" name="u" id="username" />
    </div>
    <div class="pure-control-group">
        <label for="password1">{{_("Password")}}</label>
        <input type="text" name="up1" id="password1">
    </div>
    <div class="pure-control-group">
        <label for="password2">{{_("Confirm password")}}</label>
        <input type="text" name="up2" id="password2">
    </div>
    <div class="pure-control-group">
        <label for="expiration">{{_("Expiration")}}</label>
        <select class="bool" name="expiration">
            <option value="0" selected="selected">{{_("Never expire")}}</option>
            <option value="30">{{_("1 Month")}}</option>
            <option value="90">{{_("3 Months")}}</option>
            <option value="180">{{_("6 Months")}}</option>
            <option value="365">{{_("1 Year")}}</option>
        </select>
    </div>
    <div class="pure-controls">
        <button type="submit" class="pure-button">{{_("Add")}}</button>
    </div>
</fieldset>
</form>
<p>{{_("Accounts")}}</p>
<table class="pure-table pure-table-bordered usrtb">
    <thead><tr>
        <th>{{_("No.")}}</th>
        <th>{{_("Username")}}</th>
        <th>{{_("Enable")}}</th>
        <th colspan="2">{{_("Operation")}}</th>
    </tr></thead>
    <tbody>
    {% for u in users -%}
    <tr>
    <th>{{loop.index}}</th>
    <th>{{u.name}}</th>
    <th>{{u.enable_send}}</th>
    <th><a href="/mgrpwd/{{u.name}}" class="actionButton">{{_("Change")}}</a></th>
    <th><a href="delaccount/{{u.name}}" class="actionButton">{{_("Delete")}}</a></th>
    </tr>
    {% endfor -%}
    </tbody>
</table>
{% endif -%}
{% endblock -%}
